//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//********************************************************* 

using System.Drawing;
using System.Reflection;
using System.Resources;

namespace Microsoft.TridentWordAddIn.ResourceHelper
{
    public sealed class ResourceFetcher
    {
        private static ResourceManager resourceManager =
           new ResourceManager("Microsoft.TridentWordAddIn.ResourceHelper.Resource", Assembly.GetExecutingAssembly());

        /// <summary>
        /// Prevents a default instance of the ResourceFetcher class from being created
        /// </summary>
        private ResourceFetcher()
        {
        }

        /// <summary>
        /// Gets the string.
        /// </summary>
        /// <param name="name">The name of resourse to be fetched</param>
        /// <returns>string</returns>
        public static string GetString(string name)
        {
            return resourceManager.GetString(name);
        }

        /// <summary>
        /// Gets the string.
        /// </summary>
        /// <param name="name">The name of resourse to be fetched</param>
        /// <returns>Image</returns>
        public static Image GetImage(string name)
        {
            return resourceManager.GetObject(name) as Image;
        }
    }
}
